package edu.tsinghua.ddb.main.console;

import java.rmi.RemoteException;

import edu.tsinghua.ddb.site.SiteImp;
import edu.tsinghua.ddb.site.SitePool;

public class Main {

	/**
	 * @param args
	 * @throws RemoteException
	 */
	public static void main(String[] args) throws RemoteException {
		String siteName = null;
		if (args.length == 0) {
			// which site are you in?
			MyLog.info("input site name(must in config)>");
			siteName = Console.ReadLine();
		} else if (args.length == 1) {
			// take it as site name, such as "site1"
			siteName = args[0];
		} else {
			throw new Error("too many args!");
		}

		SitePool.me = new SiteImp(siteName);

		new Console(SitePool.me).beginReading();

	}

}
